Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate language files #336

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Separate language files #336

wants to merge 14 commits into from

Conversation

holtkamp
Copy link
Collaborator

Initial approach to separate non-default language files

@holtkamp
Copy link
Collaborator Author

holtkamp commented Mar 29, 2017

A problem is that the language files as loaded by $.ajax should be located relative to the HTML page (and not relative to the .js file) that uses the functionality, so using relative URLs will be a no-go... 😞

http://stackoverflow.com/questions/36369082/relative-paths-with-fetch-in-javascript

@mazipan
Copy link
Contributor

mazipan commented Mar 30, 2017

maybe we can setup browsersync (https://browsersync.io/) for gulp in development phase.
so there is no problem with ajax.

@holtkamp
Copy link
Collaborator Author

@mazipan I don't see how this circumvents the problem?

Suppose I have a webpage, which references to the JavaScript files on CDNJS:

Then the English translation file will be loaded relative to the .html page, so from:

Instead of:
https://cdnjs.cloudflare.com/ajax/libs/jquery-date-range-picker/0.14.4/locales/en.json

We might be able to circumvent this by introducing a configuration option basePath that a user has to point to https://cdnjs.cloudflare.com/ajax/libs/jquery-date-range-picker/0.14.4/, but I think that is a big disadvantage / not worth it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants